﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YmtAuth.Domain.Model.LoginAuth;
using YmtAuth.Domain.Repository;
using YmtAuth.Dto;
using YmtAuth.Repository.MySQL;
using YmtSystem.CrossCutting;

namespace YmtAuth.AppService.Safe
{
    class SafeInfoQueryAppService
    {
        private static  readonly  IIpAreaInfoRepository IpAreaInfoRepo=new IpAreaInfoRepository();
        private static readonly IUserDeviceAuthRepository deviceRepo=new UserDeviceAuthRepository();
        public static ResponseData<IEnumerable<dynamic>> GetUserAuthInfo(string loginId)
        {
            YmtSystemAssert.AssertArgumentNotEmpty(loginId, "无效的LoginId");
            var query = UserLoginAuthSpecifications.MatchLoginKey(loginId);
            var ulc = LocalServiceLocator.GetService<IUserLoginBillsRepository>().FindOne(query, true);
            if (ulc == null)
                return ResponseData<IEnumerable<dynamic>>.CreateFail(Enumerable.Empty<dynamic>(), errorCode: "404",
                    lastErrorMessage: "user not find");

            return ResponseData<IEnumerable<dynamic>>.CreateFail(Enumerable.Empty<dynamic>(), errorCode: "404",
                   lastErrorMessage: "user not find");
        }
    }
}
